class Solution {
public:
    int brokenCalc(int s, int t) {
        int ret = 0;
        while (s != t) 
        {
            if (t % 2 != 0)
                t += 1;
            else 
            {
                if (t > s)
                    t /= 2;
                else
                    t += 1;
            }
            ret++;
        }
        return ret;
    }
};
